using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using T2.WebSecurity.Data.Controllers.Interfaces;
using T2.WebSecurity.Data.Entities.Interfaces;
using T2.WebSecurity.Business.Entities.Interfaces;
using T2.WebSecurity.Business.Entities;
using T2.WebSecurity.Data.Controllers;
using T2.WebSecurity.Business.Builders.Interface;
using T2.WebSecurity.Business.Translators;
using T2.WebSecurity.Business.Entities.Search.Interfaces;
using T2.WebSecurity.Data.Entities.Search.Interfaces;


//--Change Management Control - UsersInRoles Builder  --**********************
//--Created By: trooks
//--Description: UsersInRoles Builder Class
//--Created Date: 03/07/2013 10:48:50
//--*************************************************************

namespace T2.WebSecurity.Business.Builders
{
	public partial class UsersInRoles_Builder : IUsersInRoles_builder 
	{
		
	public List<IUsersInRoles_biz> BuildParts (IUsersInRoles_biz _param)
	{
			IUsersInRoles_biz temp = new UsersInRoles_biz();
			IUsersInRolesController cont = new UsersInRolesController();
			List<IUsersInRoles_biz> tempList = new List<IUsersInRoles_biz>();
			List<IUsersInRoles> tempData = new List<IUsersInRoles>();
			switch (_param.Action)
			{
				case "GetOne":
				temp = UsersInRolesTranslator.TranslateFromDataLayer(cont.UsersInRoles_GetOne(UsersInRolesTranslator.TranslateToDataLayer(_param)));
				tempList.Add(temp);
				return tempList;

				case "GetAll":
				tempData = cont.UsersInRoles_GetAll(UsersInRolesTranslator.TranslateToDataLayer(_param));
				tempList = tempData.Select(p => UsersInRolesTranslator.TranslateFromDataLayer(p)).Cast<IUsersInRoles_biz>().ToList();
				return tempList;

				case "UserProfile_UsersInRoles_ByParent":
				tempData = cont.UserProfile_UsersInRoles_ByParent(UsersInRolesTranslator.TranslateToDataLayer(_param));
				tempList = tempData.Select(p => UsersInRolesTranslator.TranslateFromDataLayer(p)).Cast<IUsersInRoles_biz>().ToList();
				return tempList;

				case "ApplicationRoles_UsersInRoles_ByParent":
				tempData = cont.ApplicationRoles_UsersInRoles_ByParent(UsersInRolesTranslator.TranslateToDataLayer(_param));
				tempList = tempData.Select(p => UsersInRolesTranslator.TranslateFromDataLayer(p)).Cast<IUsersInRoles_biz>().ToList();
				return tempList;

			}
			return tempList;
}
	public List<IUsersInRoles_biz> BuildParts (IUsersInRolesSearch_biz _param)
	{
			IUsersInRoles_biz temp = new UsersInRoles_biz();
			IUsersInRolesController cont = new UsersInRolesController();
			List<IUsersInRoles_biz> tempList = new List<IUsersInRoles_biz>();
			List<IUsersInRoles> tempData = new List<IUsersInRoles>();
			tempData = cont.UsersInRoles_Search(UsersInRolesTranslator.TranslateSearchToDataLayer(_param));
			tempList = tempData.Select(p => UsersInRolesTranslator.TranslateFromDataLayer(p)).Cast<IUsersInRoles_biz>().ToList();
			return tempList;

	}
		
	}
}
